package com.boot.springboot.component.listener.service;

import com.boot.springboot.component.listener.model.CallBackInfoEvent;
import com.boot.springboot.component.listener.model.RiskCallBackInput;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 该类无需实现ApplicationListener接口，使用@EventListener装饰具体方法
 *
 * @author luowenjie
 * @since 2022/1/24 18:35
 */
@Component
@Slf4j
public class MyListener4 {

    @EventListener
    public void listener(CallBackInfoEvent event){
        RiskCallBackInput input = (RiskCallBackInput) event.getSource();
        log.info("MyListener4 监听:进来监听了,{}",input.getType());
        if ("1".equals(input.getType())) {
            //TODO 处理业务逻辑增删改查
            log.info("MyListener4 监听:匹配中了");
        }
    }

}
